import api from '@/service/api';

/* 文件上传 */
export default async (data: any): Promise<any> => {
  try {
    const { path } = await api.post('/admin/upload-image', data);
    return path ? `/api/${path}` : Promise.reject();
  } catch (e) {
    return Promise.reject(e);
  }
}
